package cn.vihub.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.vihub.pojo.ShopRoleToMenu;
import cn.vihub.service.ShopRoleToMenuService;
import cn.vihub.mapper.ShopRoleToMenuMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 64452
* @description 针对表【shop_role_to_menu(用户角色关联表)】的数据库操作Service实现
* @createDate 2025-07-17 20:43:24
*/
@Service
public class ShopRoleToMenuServiceImpl extends ServiceImpl<ShopRoleToMenuMapper, ShopRoleToMenu>
    implements ShopRoleToMenuService{

    @Override
    public Boolean removeByRoleId(Integer roleId) {
        LambdaQueryWrapper<ShopRoleToMenu> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(ShopRoleToMenu::getRoleId,roleId);
        return remove(lambdaQueryWrapper);
    }

    @Override
    public List<ShopRoleToMenu> listByRoleIdList(List<Integer> roleIdList) {
        LambdaQueryWrapper<ShopRoleToMenu> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.in(ShopRoleToMenu::getRoleId, roleIdList);
        return list(lambdaQueryWrapper);
    }

}




